package com.PAT.practice02;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2021/12/22/13:43
 * @Description:
 * @Target:
 */
public class 组个最小数 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[] ints = new int[10];
        ArrayList<Integer> arrayList = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            ints[i] = in.nextInt();
        }



        for (int i = 0; i < ints.length; i++) {
            if (ints[i]!=0){
                for (int j = 0; j < ints[i]; j++) {
                    arrayList.add(i);
                }
            }
        }

        int[] ints1 = new int[arrayList.size()];
        int index = 0;
        for (Integer integer : arrayList) {
            ints1[index++] = integer;
        }

        for (int i = 0; i < ints1.length; i++) {
            if (ints1[0]!=0){
                break;
            }else {
                if (ints1[i]!=0){
                    int temp = ints1[0];
                    ints1[0] = ints1[i];
                    ints1[i] = temp;
                    break;
                }

            }
        }


        for (int i : ints1) {
            System.out.print(i);
        }


    }
}
